Page({

  /**
   * 页面的初始数据
   */
  data: {
    searchList:[]
  },
  toContext(e:any){
    let index = e.currentTarget.dataset.index
    let currentData = this.data.searchList[index]
    wx.navigateTo({
      url:"/pages/lyContext/lyContext",
      success(res){
        res.eventChannel.emit('context',currentData)
      }
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad() {
    const eventChannel = this.getOpenerEventChannel()
    eventChannel.on('context',(searchList) =>{
      searchList.map((item:any)=>{
          item.createTime = item.createTime.substring(0,10)
          return item
      })
      this.setData({
        searchList
      })
    })
  }
})